"""
Author: HuWen
@file: page_workplace_management.py
@dateTime: 2025/8/15 09:25
加油加油！！！
"""
from common.base_page import BasePage
from playwright.sync_api import Page

from locators.basicSecurityInformation.basicProcessInfo.loc_workplace_management import WorkplaceManagementLoc


class WorkPlaceManagement(BasePage):
    def __init__(self,page: Page):
        super().__init__(page)
        self.switch_menu("安全基础管理")
        self.switch_menu("生产档案(企业)")


    def add_workplace(self, select_loc, placename, area, floor, height):
        self.check(WorkplaceManagementLoc.loc_workshop_mgr)
        self.click(WorkplaceManagementLoc.loc_create_workshop_button)
        self.select(WorkplaceManagementLoc.loc_location_selector,text=select_loc)
        self.fill(WorkplaceManagementLoc.loc_workshop_name_input,text=placename)
        self.fill(WorkplaceManagementLoc.loc_area_input,text=area)
        self.fill(WorkplaceManagementLoc.loc_floor_input,text=floor)
        self.fill(WorkplaceManagementLoc.loc_height_input,text=height)
        self.click(WorkplaceManagementLoc.loc_confirm_button)